package com.gamerole.commom.adapter.slimadapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView

abstract class SlimViewHolder<D>(itemView: View) : RecyclerView.ViewHolder(
    itemView
) {
    constructor(parent: ViewGroup, itemLayoutRes: Int) : this(
        LayoutInflater.from(parent.context).inflate(itemLayoutRes, parent, false)
    ) {
    }

    fun bind(data: D, payloads: List<Any>?) {
        onBind(data, payloads)
    }

    protected abstract fun onBind(data: D, payloads: List<Any>?)
}